﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace icecream
{
    class Program
    {
        static int countDigit(long number)
        {
            if (number < 0)
            {
                number = -number;
            }
            int count = 0;
            while (number > 0)
            {             
                number /= 10;
                count++;
            }
            return count  ;
        }

        static int countZeros(long number)
        {
            int count = 0;
            long processedDigit;
            if (number < 0)
            {
                number = -number;
            }
            while (number > 0)
            {
                processedDigit = number % 10;
                number /= 10;
                if (processedDigit == 0)
                {
                    count++;
                }
            }
            return count;

        }

        static void Main(string[] args)
        {
            
            
                string token = Console.ReadLine();
                string[] tokens = token.Split();
                int numberOfBears = int.Parse(tokens[0]);
                long number = long.Parse(tokens[1]);
                int numberOfDigits = countDigit(number);
                int numberOfZeros = countZeros(number);
                if (numberOfBears == 1 && number < 0)
                {
                    Console.WriteLine(1);
                }
                else if ((numberOfDigits - numberOfZeros) > numberOfBears)
                {
                    Console.WriteLine(0);
                }
                else
                {
                    Console.WriteLine(numberOfBears - (numberOfDigits - numberOfZeros));
                }
            
        }
    }
}
